package com.yozinga.util;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class NativeAppInvoker {

	Context mContext;
	public NativeAppInvoker(Context context) {
		mContext = context;
	}
	
	public void emailInvoker(String mailTo,String Subject,String body)
	{
		Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
		sendIntent.setType("message/rfc822");
		sendIntent.putExtra(android.content.Intent.EXTRA_EMAIL,mailTo);
		sendIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, Subject);
		sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
		mContext.startActivity(sendIntent);
	}
	
	public void browserInvoker(String url){
		Uri uri = Uri.parse(url);
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
		mContext.startActivity(intent);
	}
	
	public void dialPadInvoker(String number)
	{
		Intent dialIntent=new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+(number)));
		mContext.startActivity(dialIntent);
	}
}
